<script setup>
import { ref } from "vue";

const name = ref("张三");
const age = ref(18);
const job = ref({
  title: "总经理",
  salary: "30k",
});

function changeInfo() {
  name.value = "李四";
  age.value = 20;
  // job.value.title = "CEO";
  // job.value.salary = "50k";
  job.value = { title: "ceo", salary: "50k" };
}
</script>

<template>
  <div>
    <h1>个人信息</h1>
    <div>姓名：{{ name }}</div>
    <div>年龄：{{ age }}</div>
    <div>工作头衔：{{ job.title }}</div>
    <div>工资：{{ job.salary }}</div>
    <div>
      <button @click="changeInfo">改变信息</button>
    </div>
  </div>
</template>

<style scoped></style>
